import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from "@/layout/layout.vue";
import BookView from "@/views/BookView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Layout,
    // 管理子路由
    children: [
      {path: '/', alias: '/book' , name: 'book', component: () => import("@/views/BookView.vue")},
      {path: '/user', name: "user", component: () => import("@/views/UserView.vue")},
      {path: '/type', name: "type", component: () => import("@/views/TypeView.vue")},

    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
